﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Welcome.aspx.cs" Inherits="ZX.WebApp.Welcome" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!--CSS file (default YUI Sam Skin) -->
    <!--CSS file (default YUI Sam Skin) -->
    <link rel="stylesheet" type="text/css" href="Scripts/yui_2.9.0/build/reset-fonts-grids/reset-fonts-grids.css" />
    <link rel="stylesheet" type="text/css" href="Scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="Scripts/yui_2.9.0/build/menu/assets/skins/sam/menu.css" />
    <link rel="stylesheet" type="text/css" href="Scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="Scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link href="Styles/css.index.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        /* Table样式 */
        .tableContent
        {
            
            width: 100%;
            border-collapse: collapse;
            /*border-right: solid 1px #d6e6fa;*/
            /*border-left: solid 1px #ccc;
            /*border-right: solid 1px #ccc;*/
            
        }
        .tableContent th
        {
            /*border: solid 1px #D4DBE2;*/
            font-weight: bold; /*background-color: #F2F8FF;*/
            white-space: nowrap;
            line-height: 28px;
            text-align: left;
            border-bottom: solid 1px #d6e6fa;
            padding: 0px 6px 0px 10px; 
        }
        .tableContent td
        {
            /*border: solid 1px #D4DBE2; /*background-color: #F2F8FF;*/
            white-space: nowrap;
            line-height: 26px;
            text-align: left;
            border-bottom: solid 1px #d6e6fa;
            padding: 0px 6px 0px 10px; 
        }
A {
	COLOR: #1f376d; TEXT-DECORATION: none
}
A:hover {
	COLOR: #bd0a01; TEXT-DECORATION: underline
}
A.lchot {
	COLOR: #bd0a01
}
A.lchot:visited {
	COLOR: #bd0a01
    </style>
    <!-- Dependencies -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <!-- OPTIONAL: JSON Utility (for DataSource) -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <!-- OPTIONAL: Calendar (enables calendar editors) -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <!-- Source files -->
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="Scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script language="javascript" type="text/javascript">
        function getUrl() {
            parent.addTabs('信息发布', 'Extend/YUIList.aspx?r=' + Math.random() + '&entity=V_TrMessageIssue&editentity=TrMessageIssue&functionID=2c1434a8-5136-4d63-9c23-c53ad61fbc21');
            parent.NeedRefreshPage = this;
        }
        function getUrls() {
            parent.addTabs('知识平台', 'Extend/YUIList.aspx?r=' + Math.random() + '&entity=TrAttach&functionID=0e3fdb45-9d4c-4b90-bc63-bb0da4eeb252');
            parent.NeedRefreshPage = this;
        }
        function getDbsy() {
            parent.addTabs('心得点评', 'Extend/YUIList.aspx?r=' + Math.random() + '&entity= V_TrStudyGain&functionID=e55783c9-b666-4644-a7c6-810085e53dbf');
            parent.NeedRefreshPage = this;
        }
    </script>
</head>
<body class="yui-skin-sam">
    <form id="form1" runat="server">
    <div id="bd">
        <table style="width: 100%;" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2" valign="top">
                    <table style="width: 100%; height: 275px" border="1" cellpadding="0" cellspacing="0">
                        <tr style="background-color: #e8f2fd">
                            <td width="10%" height="27" style="background: url(../Images/Peixun/main_title_bg.gif);">
                                &nbsp;&nbsp;<span style="font-weight:bold">待办事宜</span>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="text-align: center; height:248px;">
                                <asp:Repeater ID="rptUnBegin" runat="server">
                                    <HeaderTemplate>
                                        <table class="tableContent" style="width: 100%;">
                                           <tr>
                                                <th>
                                                   标题
                                                </th>
                                                  <th>
                                                   发送人
                                                </th>
                                                 <th>
                                                   发送时间
                                                </th>
                                            </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr> 
                                            <td><span>•</span>
                                                <a href="#" name='<%#Eval("MsgContent") %>' class='<%#Eval("MPoolID") %>' id="Message">
                                                   <%# String.Format("<font color='blue'><b>{0}</b></font>", Eval("Title"))%>
                                                </a>
                                            </td>
                                            <td><span><%#Eval("AddUserName")%></span</td>
                                            <td>
                                            <%# String.Format("{0}", String.Format("{0:U}", Eval("SendTime")))%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                       <%if (numLeast==8)
                                         { %> <tr><td colspan="2" style="text-align:right;padding-right:3px;"><a href="#" onclick="getDbsy()">更多</a></td></tr>
                                            <%} %> 
                                        </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="1%">
                    &nbsp;
                </td>
                <td width="50%" valign="top">
                    <table style="width: 100%; height: 275px" border="1" cellpadding="0" cellspacing="0">
                        <tr style="background-color: #e8f2fd">
                            <td width="10%" height="27" style="background: url(../Images/Peixun/main_title_bg.gif);">
                                &nbsp;&nbsp;<span style="font-weight:bold">最新动态</span>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="text-align: center; height:248px;">
                                <asp:Repeater ID="rptnotice" runat="server">
                                    <HeaderTemplate>
                                        <table class="tableContent" style="width: 100%;">
                                            
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <td><span>•</span>
                                            <a href="#" name='<%#Eval("TrMessageIssueID") %>' id="NewMessage">
                                                    <%#Eval("IssueTitle")%></a>
                                            </td>
                                         
                                            <td>
                                                <%#Eval("AddTime")%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                            <%if (numNotice ==8)
                                         { %>
                                       <tr><td colspan="2" style="text-align:right;padding-right:3px;"><a href="#" onclick="getUrl()">更多</a></td></tr>
                                       <%}%> </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2" valign="top">
                    <table style="width: 100%; height: 275px" border="1" cellpadding="0" cellspacing="0">
                        <tr style="background-color: #e8f2fd">
                            <td width="10%" height="27" style="background: url(../Images/Peixun/main_title_bg.gif);">
                                &nbsp;&nbsp;<span style="font-weight:bold">知识平台</span>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="text-align: center; height:248px;">
                                <asp:Repeater ID="rptFile" runat="server">
                                    <HeaderTemplate>
                                        <table class="tableContent" style="width: 100%;">
                                          
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                          
                                            <td><span>•</span>
                                                <a href="javascript:void(0)" name='<%#Eval("TrAttachID") %>' id="Attach">
                                                    <%#Eval("AttachName") %></a>
                                                </td>
                                            <td>
                                                <a title='<%#Eval("AttachName") %>'  target="_blank" href='EditWidows/DownLoad.aspx?filename=<%#Eval("Address") %>'>
                                                    下载</a>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                    <%if (numAttach==8)
                                      { %> <tr><td colspan="2" style="text-align:right;padding-right:3px;"><a href="#" onclick="getUrls()">更多</a></td></tr> 
                                      <%} %>  </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="1%">
                    &nbsp;
                </td>
                <td valign="top">
                    <table style="width: 100%; height: 275px" border="1" cellpadding="0" cellspacing="0">
                        <tr style="background-color: #e8f2fd">
                            <td width="10%" height="27" style="background: url(../Images/Peixun/main_title_bg.gif);">
                                &nbsp;&nbsp;<span style="font-weight:bold">互动平台</span>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="text-align: center; height:248px;">
                                <asp:Repeater ID="rptHudong" runat="server">
                                    <HeaderTemplate>
                                        <table class="tableContent" style="width: 100%;">
                                           
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <td><span>•</span>
                                                <%#Eval("IssueTitle")%>
                                            </td>
                                            <td>
                                                <a title='<%#Eval("NetAddress") %>' target="_blank" href='//<%#Eval("NetAddress") %>'>
                                                    <%#Eval("NetAddress") %></a>
                                            </td>
                                          
                                        </tr>
                                        
                                    </ItemTemplate>
                                    <FooterTemplate>
                                  <%if (numHd==8)
                                    { %> <tr><td colspan="3" style="text-align:right;padding-right:3px;"><a href="#" onclick="getUrl()">更多</a></td></tr>
                                        <%} %></table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div id="dialog1" class="yui-pe-content">
        <div class="hd">
            资料下载</div>
        <div class="bd">
            <iframe id="EditUIWindow" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    <div id="dialog2" class="yui-pe-content">
        <div class="hd">
          最新动态</div>
        <div class="bd">
            <iframe id="EditUIWindow2" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
        <div id="dialog5" class="yui-pe-content">
        <div class="hd">
           数据详情</div>
        <div class="bd">
            <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    </form>
</body>
<script type="text/javascript">
    var Tag=true;
    var mpoolIDValue;//信息池ID
   
    ///------------------------------------
    //系统的改修Message状态方法
    ///------------------------------------
    function fnMessageSendState(mpoolID) {
        ///初始化相关参数
        var url = "MessagePoolManage.aspx",
            action = "setSendState";
        if (mpoolID == "") { return; }
        var SaveUrl = url + "?r=" + Math.random() + "&poolid=" + mpoolID + "&action=" + action;

        //发送保存请求
        YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
            success: function (res) {
                try {
                    var str = res.responseText;
                    //                        if (str == "1")
                    //                        {
                    //                            alert("数据保存成功");
                    //                        }
                    //                        else
                    //                        {
                    //                            showCss("red");
                    //                            alert(str+"\n"+"数据保存失败!");
                    //                        }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
    }

    function LoadData() {
        fnMessageSendState(mpoolIDValue);
        this.location = "../Welcome.aspx?r=" + Math.random();
   
    }

    (function () {
        var Dom = YAHOO.util.Dom,
        Event = YAHOO.util.Event;
        Event.onDOMReady(function () {
            var layout = new YAHOO.widget.Layout({
                minHeight: 150,
                units: [
                { position: 'center', body: 'bd', gutter: '2 2 2 2', scroll: true }
            ]
            });
            layout.render();
        });
    })();


    //添加超链接点击事件
    $(document).ready(function () {
        $("a[id^=Attach]").click(function () {
            var nameValue = $(this).attr("name");
            document.getElementById("EditUIWindow").src = "TR/ExplainAttach.aspx?id=" + nameValue;
            YAHOO.example.container.dialog1.show();
        });
        $("a[id^=NewMessage]").click(function () {
            var nameValue = $(this).attr("name");
            document.getElementById("EditUIWindow2").src = "TR/MessageView.aspx?msid=" + nameValue;
            YAHOO.example.container.dialog2.show();
        });
        $("a[id^=Message]").click(function () {
            var nameValue = $(this).attr("name");
            mpoolIDValue = $(this).attr("class");
            document.getElementById("EditUIWindow1").src = nameValue;
            // fnMessageSendState(mpoolIDValue);
            YAHOO.example.container.dialog5.show();
        });
    })

    YAHOO.namespace("example.container");
    YAHOO.util.Event.onDOMReady(function () {

        // Define various event handlers for Dialog
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow");
            if (editwindow) {
                editwindow.contentWindow.Save();
            }
        };

        var handleMessage = function () {
            var editwindow = document.getElementById("EditUIWindow1");
            if (editwindow) {
                editwindow.contentWindow.Save();
                YAHOO.example.container.dialog5.hide();
            }
        }


        var handleCancel = function () {
            this.cancel();
        };
        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        var const_EditWindowWidth = "<% =650 %>px",
		const_EditWindowHeight = "<% =450 %>px";
        // Remove progressively enhanced content class, just before creating the module
        YAHOO.util.Dom.removeClass("dialog1", "yui-pe-content");

        // Instantiate the Dialog
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
							    { width: const_EditWindowWidth,
							        height: const_EditWindowHeight,
							        fixedcenter: true,
							        visible: false,
							        draggable: true,
							        close: true,
							        autofillheight: "body",
							        constraintoviewport: true,
							        buttons: [
								          { text: "取消", handler: handleCancel}]
							    });

        YAHOO.example.container.dialog2 = new YAHOO.widget.Dialog("dialog2",
							    { width: const_EditWindowWidth,
							        height: const_EditWindowHeight,
							        fixedcenter: true,
							        visible: false,
							        draggable: true,
							        close: true,
							        autofillheight: "body",
							        constraintoviewport: true,
							        buttons: [
								          { text: "取消", handler: handleCancel}]
							    });
        YAHOO.example.container.dialog5 = new YAHOO.widget.Dialog("dialog5",
							    { width: 600,
							        height: 480,
							        fixedcenter: true,
							        visible: false,
							        draggable: true,
							        close: true,
							        autofillheight: "body",
							        constraintoviewport: true,
							        buttons: [{ text: "确定", handler: handleMessage, isDefault: true },

								          { text: "取消", handler: handleCancel}]

							    });
        YAHOO.example.container.dialog5.render();
        // Validate the entries in the form to require that both first and last name are entered
        YAHOO.example.container.dialog1.validate = function () {
            var data = this.getData();
            if (data.firstname == "" || data.lastname == "") {
                alert("Please enter your first and last names.");
                return false;
            } else {
                return true;
            }
        };

        // Wire up the success and failure handlers
        YAHOO.example.container.dialog1.callback = { success: handleSuccess,
            failure: handleFailure
        };
        // Render the Dialog
        YAHOO.example.container.dialog1.render();
        YAHOO.example.container.dialog2.render();
        //添加超链接监听事件
        //YAHOO.util.Event.addListener("Attach", "click", YAHOO.example.container.dialog1.show, YAHOO.example.container.dialog1, true);

        //拖动大小
        var resize = new YAHOO.util.Resize("dialog1", {
            handles: ["br"],
            autoRatio: false,
            minWidth: 650,
            minHeight: 450,
            status: false
        });
        resize.on("startResize", function (args) {

            if (this.cfg.getProperty("constraintoviewport")) {
                var D = YAHOO.util.Dom;

                var clientRegion = D.getClientRegion();
                var elRegion = D.getRegion(this.element);

                resize.set("maxWidth", clientRegion.right - elRegion.left - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
                resize.set("maxHeight", clientRegion.bottom - elRegion.top - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
            } else {
                resize.set("maxWidth", null);
                resize.set("maxHeight", null);
            }

        }, YAHOO.example.container.dialog1, true);
        resize.on("resize", function (args) {
            var panelHeight = args.height;
            this.cfg.setProperty("height", panelHeight + "px");
        }, YAHOO.example.container.dialog1, true);
        //拖动大小
        var resize2 = new YAHOO.util.Resize("dialog2", {
            handles: ["br"],
            autoRatio: false,
            minWidth: 450,
            minHeight: 400,
            status: false
        });
        resize.on("startResize", function (args) {

            if (this.cfg.getProperty("constraintoviewport")) {
                var D = YAHOO.util.Dom;

                var clientRegion = D.getClientRegion();
                var elRegion = D.getRegion(this.element);

                resize.set("maxWidth", clientRegion.right - elRegion.left - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
                resize.set("maxHeight", clientRegion.bottom - elRegion.top - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
            } else {
                resize.set("maxWidth", null);
                resize.set("maxHeight", null);
            }

        }, YAHOO.example.container.dialog1, true);
        resize.on("resize", function (args) {
            var panelHeight = args.height;
            this.cfg.setProperty("height", panelHeight + "px");
        }, YAHOO.example.container.dialog2, true);
    });
</script>
</html>
